<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <script type="text/javascript">
        var wtEvent = {
            event:{
                //"addBuyCar":[fn1,fn2,fn3]
            },
            addEvent:function(eventName,fn){
                if(this.event[eventName]==undefined){
                    this.event[eventName]=[];
                }
              this.event[eventName].push(fn);
            },
            removeEvent:function(eventName,fn){
                var fnList = this.event[eventName];
                var that = this;
                fnList.forEach(function(item,i){
                    if(item==fn){
                        that.event[eventName].splice(i,1);
                    }
                })
            },
            emit:function(eventName, eventMsg){
                var fnList = this.event[eventName];
                fnList.forEach(function(item,i){
                    item(eventMsg);
                })
            }
        };
        var abc = function(event){
                    console.log(event);
                    console.log("王腾演唱会门票价格");
                }

        wtEvent.addEvent("王腾演唱会",abc);

       // wtEvent.removeEvent("王腾演唱会",abc);
        wtEvent.addEvent("王腾演唱会", function (event) {
                console.log("王腾演唱会曲目");
            })
        wtEvent.addEvent("王腾演唱会", function (event) {
                console.log("王腾演唱会地点");
            })
                
        </script>
    </body>
</html>